package com.dhecp.project.hr.service.impl;

import com.dhecp.core.constant.DataFiltering;
import com.dhecp.core.utils.PageUtils;
import com.dhecp.project.hr.domain.DataExecution;
import com.dhecp.project.hr.mapper.DataExecutionMapper;
import com.dhecp.project.hr.service.DataExecutionService;
import com.dhecp.project.system.service.SysDictionaryForFieldService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @Author fxz
 * @Description //数据执行
 * @Date 2023/1/30 16:10
 **/
@Service
public class DataExecutionServiceImpl implements DataExecutionService {

    private static final Logger logger = LoggerFactory.getLogger(DataExecutionServiceImpl.class);


    @Autowired
    private SysDictionaryForFieldService dictionaryForFieldService;

    @Autowired
    private DataExecutionMapper dataExecutionMapper;


    @Override
    public List<DataExecution> queryDataExecutionList(Map<String, Object> params) throws Exception{
        return dataExecutionMapper.query(params);
    }

    @Override
    public void addDataExecution(Map<String, Object> params) {
        try {
            dataExecutionMapper.addDataExecution(params);
        }catch (Exception ex){
            logger.error("调用API接口保存日志出错，错误信息为：" + ex.getMessage());
        }
    }

    @Override
    public void updateDataExecution(Map<String, Object> paramse) {
        try {
            dataExecutionMapper.updateByPaymentTime(paramse);
        }catch (Exception ex){
            logger.error("调用API接口保存日志出错，错误信息为：" + ex.getMessage());
        }
    }
}
